// 导入request
import request from "./request.js";

// 定义获取大纲接口
export const getOutlines = () => request({
    method: "get",
    url: `/outlines`,
});

// 定义获取单个大纲接口 (数据回填)
export const getOutline = (id) => request({
    method: "get",
    url: `/outlines/${id}`,
});

// 定义添加大纲接口
export const addOutlines = (data) => request({
    method: "post",
    url: `/outlines`,
    data,
});

export const exist = (params) => request({
    method: "get",
    url: `/outlines/exist`,
    params,
});

// 定义删除大纲接口
export const deleteOutline = (id) => request({
    method: "delete",
    url: `/outlines/${id}`,
});

// 定义编辑大纲接口
export const editOutline = (id, data) => request({
    method: "put",
    url: `/outlines/${id}`,
    data,
});

// 定义获取大纲排序
export const sortOutline = (firstId,secondId) => request({
    method:'put',
    url:`/outlines/sort/${firstId}/${secondId}`
})